from abc import ABCMeta, abstractmethod
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait

class WebBase(metaclass=ABCMeta):
    '''
    网页交互基类
    '''
    def __init__(self):
        self._browser=webdriver.Chrome()
        self._browser.set_window_size(1200, 1200)
        self._wait = WebDriverWait(self.browser,10)
        self._online=False
        pass

    @property
    def browser(self):
        return self._browser

    @browser.setter
    def browser(self, value):
        self._browser = value

    @property
    def wait(self):
        return self._wait

    @wait.setter
    def wait(self, value):
        self._wait = value

    @property
    def online(self):
        return self._online

    @online.setter
    def online(self, value):
        self._online = value

    @abstractmethod
    def login(self):
        pass

    @abstractmethod
    def verify(self):
        pass

    @abstractmethod
    def get_curr_data(self):
        pass

    @abstractmethod
    def get_all_1000_data(self):
        pass

    @abstractmethod
    def post(self):
        pass